package com.googlecode.bts_lambda;

/**
 * User: Timofey Bondarev
 * Date: 22.05.11
 * Time: 19:03
 */

public class LParser {
    public static LTerm parseLambdaTerm(String term) {
        term = new String(term.toCharArray());
        term = term.trim();
        // todo дописать реализацию
        return null;
    }

    public static LVariable parseLambdaVariable(String variable) {
        variable = variable.trim();
        if (variable.length() == 0) {
            throw new IllegalArgumentException("variable must have latin symbols");
        }
        int i = 0;
        while (variable.charAt(i++) != ' ');
        return new LVariable(variable.substring(0, i - 1));
    }
}
